package com.zrq.powernode.springdatajpa.controller;

import com.zrq.powernode.springdatajpa.dao.UserDao;
import com.zrq.powernode.springdatajpa.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

import java.util.List;

@Controller
public class UserController {
    @Autowired
    //注入
    private UserDao userDao;

    public List<User> getUser(){
        List<User> list = userDao.findAll();
        for (User u:list) {
            System.out.println(u.getName()+"="+u.getAddress());
        }
        return list;
    }


}
